package 第二十章项目.clothesSystem.wrap;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public enum PersonEnum {
    ENUM1,
    ENUM2;
    public String getProperty(String propertyName){
        String prefix=name()+".";
        Properties props= LoadProperties();
        return props.getProperty(prefix+propertyName);
    }
    private Properties LoadProperties(){
        Properties props=new Properties();
        InputStream input =getClass().getClassLoader().getResourceAsStream("PersonInfo.properties");
        try {
            props.load(input);

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return props;
    }

}
